package net.pm.core.web.user;

import javax.annotation.Resource;

import net.pm.core.entities.db.Pmdept;
import net.pm.core.service.pmuser.PMDeptServicer;
import net.pm.core.web.BaseController;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


@Controller
@RequestMapping("/dept/")
@Scope("request")
public class DeptController extends BaseController {
	
	@Resource(name="PMDeptServicer")
	private PMDeptServicer deptServicer;
	
	/**
	 * 查看部门详细信息
	 * @return
	 */
	@RequestMapping(value="info",method=RequestMethod.GET)
	public ModelAndView info(){
		ModelAndView mav = new ModelAndView("dept/dept_info");
		Pmdept dept = deptServicer.findEntityById(super.obtainCurrentDept().getId());
		mav.addObject("dept", dept);
		return mav;
	}
}
